/**
 * Created by kangli on 2018/3/7.
 */
//新增角色
function addRole(btn){
    var html ='  <div class="g-confirmDiv">' +
        '<div class="g-confirmlist clearfix"><p class="fl">角色ID：</p> ' +
        '<span class="units">2</span></div> ' +
        '<div class="g-confirmlist clearfix"><p class="fl">角色描述：</p> ' +
        '<input type="text" class="form-control fl" style="width: 200px"></div> ' +
        '<div class="g-confirmlist clearfix"><p class="fl">权限分配：</p> ' +
        '<div class="fl rm-selectDiv">' +
        '<select class="form-control fl rm-select" style="width: 200px"> ' +
        '<option value="1">系统管理员</option> ' +
        '<option value="2">用户</option> ' +
        '</select> <span class="fl"><img src="../img/add.png" class="newSelect"></span></div></div></div>';
    parent.layer.open({
        type: 1,
        area: ['500px', ''],
        title: '新增角色',
        btn: ['确定','取消'],
        shadeClose: true, //点击遮罩关闭
        content: html,
        success: function(layero, index){
             parent.$(".newSelect").click(function(){
                 console.log(111)
               var selectnextDiv = parent.$(".rm-select").eq(0).clone();
                 console.log($(selectnextDiv))
                 selectnextDiv.insertAfter(parent.$(".rm-select").eq(0));
             })
        },
        yes: function(index){

        },
        btn2: function(index){
            parent.layer.close(index);
            /*   return false;*/
        }
    });
}